********************************************************************************
*
*	Date: May 23 2024 
*	This do-file replicates selected tables and figures in: 
*	Karoline Larsen Kolstad. 2024. Overburdened Bureaucrats: Providing Equal Access to Public Services during Covid-19.
*	
*	by conducting all analysis based on data collected from other sources than Statistics Denmark reported in the appendix. 
*
*	To produce all results three datasets are needed
*	1) google_searches
*	2) caseworkers_number
*	3) caseworkers_userorientation
*
********************************************************************************

cd "Set directory"

********************************************************************************
******************************APPENDIX B: ANTICIPATION**************************
********************************************************************************

*Figure B1: Number of Google searches on "Corona" and "COVID-19" in Denmark
use "google_searches"
tsset date, daily

tsline searches_corona searches_covid, xline(21985) lcolor(black) ytitle("Number of searches") xtitle("Date") ///
lpattern(solid dash_dot) lcolor(black black) legend(order(1 "Corona" 2 "COVID-19")) xscale(titlegap(3)) ///
yscale(titlegap(3))  ylabel(, nogrid) xlabel(21915 22005 22081 22153, nogrid) || pcarrowi 70 22000 70 21985 "Lockdown", ///
mcolor(black) mlabcolor(black) lcolor(black)
graph export "fig_b1_google.png", replace

*Figure B2: Number of Caseworkers 
use "caseworkers_number"

tsset occupation year_month, monthly 

twoway (line employees_number year_month if occupation== 1, lcolor(black) lpattern(solid)) ///
(line employees_number year_month if occupation == 2, lcolor(black) lpattern(shortdash_dot)) ///
(pcarrowi 3500 725 3500 722 "Lockdown", mcolor(black) mlabcolor(black) lcolor(black)) ///
(pcarrowi 3700 725 3700 724 "Reopening", mcolor(black) mlabcolor(black) lcolor(black)), ///
xline(722 724, lcolor(black) lp(dash) lwidth(thin)) ylabel(1500(1000)5000, nogrid labsize(small)) /// 
xtitle("Year, month") ytitle("Number of caseworkers") legend(size(small) position(6) rows(1) /// 
order(1 "Social Workers" 2 "Job Consultants")) xlabel(708 716 724 735, nogrid labsize(small) ) ///
xsc(titlegap(+3)) ysc(titlegap(+3)) 
qui graph export "figur_b2_caseworkers.png", replace


********************************************************************************
******************************APPENDIX D: Caseworkers' User Orientation*********
********************************************************************************

*Figur D1: Caseworkers' User Orientation 

use "caseworkers_userorientation"

histogram userorientation, xtitle("User Orientation", size(medium)) ytitle("Percent", size(medium)) percent color(gs10) xsc(titlegap(+3)) ysc(titlegap(+3)) xlabel(, nogrid) ylabel(, nogrid)
qui graph export "figur_d1_brugerorientering.png", replace

********************************************************************************